﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using QLTour.Dal;

namespace QLTour.Biz
{
    public class TourBiz
    {
        public string MaTour { get; set; }
        public string Ten { get; set; }
        public Boolean TrongNuoc { get; set; }
        public TourBiz(string ma, string ten, bool trongnuoc)
        {
            MaTour = ma;
            Ten = ten;
            TrongNuoc = trongnuoc;
        }
        private TourDal dal = new TourDal();

        public TourBiz()
        {
        }

        public Boolean Insert()
        {
            return dal.Insert(this);
        }
        public Boolean Update()
        {
            return dal.Update(this);
        }

        public static List<TourBiz> GetAllTours()
        {
            TourDal dal = new TourDal();
            List<TourBiz> rs = dal.GetAllTours();
            return rs;
        }

        public List<DiaDiemBiz> GetAllDiaDiem()
        {
            return dal.GetAllDiaDiem(this);
        }

        public List<GiaTourBiz> GetAllGiaTour()
        {
            return dal.GetAllGiaTour(this);
        }

        public int XoaHetGia()
        {
            return dal.XoaHetGia(this);
        }

        public bool Delete()
        {
            return dal.XoaTour(this);
        }
    }
}
